<?php
namespace app\common\model;
use think\Model;
use traits\model\SoftDelete;
class Cate extends Model{
    protected static function init()
    {
        Cate::afterWrite(function ($model) {
            cache("cms_".$model['cms_id'],null);
        });
        Cate::afterUpdate(function ($model) {
            cache("cms_".$model['cms_id'],null);
        });
    }
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    public function getTypeTextAttr($value,$data)
    {
        $status = [0=>'文字列表',1=>'图片列表'];
        return $status[$data['type']];
    }
}